<%@page import="com.wanmait.cookBook.vo.Pagers"%>
<%@page import="com.wanmait.cookBook.vo.Cook"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.cookBook.vo.Userinfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path = request.getContextPath();%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="alternate" media="only screen and (max-width: 640px)"  href="https://m.meishichina.com/space/404188/">
<link rel="shortcut icon" href="https://static.meishichina.com/v6/img/lib/f.ico"/>
<link rel="apple-touch-icon" href="https://static.meishichina.com/v6/img/lib/wapico.png" />
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/lib/all.css?v1=13">
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/app/center/space.css?v1=2018-06-12">
</head>
<body>
<jsp:include page="/front/head.jsp"></jsp:include>
<div class="space_wrap" style="margin-top:0px;">
<div class="space_info w">
<div class="mod clear">
<div class="pic">
<!-- 从session中取出loginUser对象 -->
<%Userinfo loginuser=(Userinfo)session.getAttribute("loginuser"); %>
<a href=""><img class="imgLoad" src="<%=request.getContextPath() %>/front/userImages/<%=loginuser.getUserFace() %>" width="150" height="150" alt=""></a>
</div>
<div class="detail">
<div class="subname">

<em><a href="<%=request.getContextPath()%>/PersonalServlet"><%=loginuser.getUserName() %></a></em>
<%boolean flag=loginuser.isUserSex();
      String sex=""; 
	if(flag==true){
		sex="man";
	}
	else{
		sex="woman";
	}
%>
<i class="space_icon <%=sex%>"></i><!-- 男女显示不同的图片 -->
<br>
<i class="messagenum"><%=loginuser.getRegisteTime() %>&nbsp;加入</i>
<br>
<i class="messagenum"><%=loginuser.getWords() %></i>
<i class="messagenum"><%=loginuser.getUserEmail() %></i>
</div>

<div class="subtools clear">


<div class="subbtn left" style="display:none">

</div>
<div class="right">
<ul class="substatus">
<li>
<a title="粉丝" href="javascript:void(0);" rel="nofollow">
<b class="followedcount"><%=request.getAttribute("fansCount") %></b><br>
粉丝
</a></li>
<li>
<a title="关注" href="javascript:void(0);" rel="nofollow">
<b class="followingcount"><%=request.getAttribute("focusCount") %></b><br>
关注
</a></li>
<li class="last">
<a title="赞与收藏" href="javascript:void(0);" rel="nofollow">
<b class="viewnum"><%=request.getAttribute("likeCount") %></b><br>
获赞数
</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
	<!-- 主框架 -->
	<div class="wrap">
		<div class="w clear">
			
<div class="ui_title mt10">
			  <div class="ui_title_wrap clear">
				  <h3 class="on"><a target="_blank"  href=""><%=loginuser.getUserName()%>的菜谱</a></h3>
      <a href="javascript:void(0)" class="recipe_ser"></a>
      <%Pagers pagers =(Pagers)request.getAttribute("page"); %>
				  <a target="_blank" class="right" href="">共<%=request.getAttribute("count")%>篇</a>
			  </div>
		  </div>
<div class="search_b">
<span>
					<!--搜索的form表单  -->
		<form method="post" action="<%=request.getContextPath()%>/CookServlet?action=getAllCook">
				<input name="cookName" id="tbid" onkeydown="keyLogin()"  placeholder="搜索<%=loginuser.getUserName() %>的菜谱" type="text" >&nbsp;
				<input  value="&#12288;搜索&#12288;" type="submit" id="tbid_btn" class="ui_btn" />
			</span>
		</form>	

&nbsp;
</div>

<div class="big4_list clear mt10">
<ul>
			 <!-- 循环作品  从Cookservlet转发过来-->
			 <%ArrayList<Cook> allCook=(ArrayList<Cook>)request.getAttribute("allCook"); %>
			  		  <%for(Cook cook:allCook){%>
			  		
			  		  <li>
				  <a title="作品名" href="" target="_blank">
						<span class="copyright"><%=loginuser.getUserName()%>独家</span>
			
			  <i>
				  <img alt="<%=cook.getCookName() %>" class="imgLoad" src="<%=request.getContextPath() %>/front/cookFaceImage/<%=cook.getCookPicture() %>"  data-src="">
			  </i>
			  <p><%=cook.getCookName()%></p>
		  </a>
		  </li>
		  <% 					  
			}
		  %> 		  
</ul>
</div>
<!-- 分页的div -->
<div id=fenYe>
<%
	String cookName = request.getParameter("cookName");//文本框输入的字 因为转发 是一个request
	cookName = cookName==null?"":cookName;
	%>

			<a href="<%=request.getContextPath()%>/CookServlet?cookName=<%=cookName %>&action=getAllCook&pageNo=<%=pagers.getPageNo()-1%>">上一页</a>
	
			<%
				for(int i=1;i<=pagers.getPageCount();i++){%>
				
			【<a class="no<%=i %>" href="<%=path %>/CookServlet?cookName=<%=cookName %>&action=getAllCook&pageNo=<%=i%>"><%=i %></a>】
			<%	
				}			
				%>	
			<a href="<%=request.getContextPath()%>/CookServlet?cookName=<%=cookName %>&action=getAllCook&pageNo=<%=pagers.getPageNo()+1%>">下一页</a>
</div>


</script>
<style>
#fenYe{
	margin-left:480px;
}
</style>
<style type="text/css">
.footer-area{padding:10px 0}.footer-area .w{padding-top:10px;border-top:1px solid #e8e8e8}.footer-area a{color:#666}.footer-area a:hover{color:#ff6767}.ft1{clear:none;float:left;font-size:11px;color:#666;width:680px;padding-top:10px}.ft1 .c3b{color:#c90;font-size:14px;font-weight:700;margin-bottom:6px}.ft1 .c3b a{color:#f50}.ft1 .c3c{color:#aaa;font-size:12px;margin-bottom:6px}.ft2,.ft3,.ft4{clear:none;float:right;text-align:center}.ft3{margin:0 25px}
</style>	


<!-- 引用全站js -->
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript">
msc.user.init();
msc.goTop.init(); 
$("img.imgLoad").imgLoad();
</script>
<script type="text/javascript">
  $(function(){
    var uid=$(".space_nav_wrap ul").attr('data-id');
    $.get("/ajax/ajax.php?ac=user&op=getUserNum",{uid:uid},function (d) {
      if(d.error==0){
          $(".followedcount").text(d.data.followedcount)
          $(".followingcount").text(d.data.followingcount)
          $(".viewnum").text(d.data.viewnum)
      }
    },"json")
  });
  $(".recipe_ser").click(function(){
    if($(".search_b").is(":hidden")){
      $(".search_b").slideDown();
      setTimeout(function () {
        $(".search_b #tbid").focus()
      },500)
    }
    else{
      $(".search_b").slideUp();
    }
  });
  $(".close").click(function () {
    $(".search_b").slideUp();
  });
  $("#tbid_btn").click(function () {
    var val=$("#tbid").val()
    if($.trim(val)==''){
      msc.ui.dialog.error("请输入菜谱名称");
      $(".search_b #tbid").val('');
      $(".search_b #tbid").focus();
      return false
    }else{
      window.location.href="https://home.meishichina.com/space-404188-do-recipe-search-"+$.trim(val)+".html";
    }
  });
  function keyLogin() {
    if (event.keyCode==13){
      $("#tbid_btn").click()
    }
  }
  var val=$("#tbid").val();
  if($.trim(val)!=''){
    $(".search_b").css("display","block");
  }
</script>
<script>
$("li.top_bar_more").hoverDelay(function(){$("li.top_bar_more div").show()},function(){$("li.top_bar_more div").hide()},200,200);var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="//hm.baidu.com/hm.js?fb9cd9dcdda23cee0c7357db9be24acb";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();
</script> 
<script src="<%=request.getContextPath() %>/front/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
$(function(){
	$(".no<%=pagers.getPageNo()%>").css("color","red");
});
</script> 
<jsp:include page="/front/footer.jsp"></jsp:include>
</body>
</html>